package com.qiuyuliantu.base.service.impl;

import com.qiuyuliantu.base.domain.QiuGoalsModel;
import com.qiuyuliantu.base.mapper.QiuGoalsModelMapper;
import com.qiuyuliantu.base.service.IQiuGoalsModelService;
import com.qiuyuliantu.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 目标模板Service业务层处理
 *
 * @author ruoyi
 * @date 2025-03-22
 */
@Service
public class QiuGoalsModelServiceImpl implements IQiuGoalsModelService
{
    @Autowired
    private QiuGoalsModelMapper qiuGoalsModelMapper;

    /**
     * 查询目标模板
     *
     * @param id 目标模板主键
     * @return 目标模板
     */
    @Override
    public QiuGoalsModel selectQiuGoalsModelById(Long id)
    {
        return qiuGoalsModelMapper.selectQiuGoalsModelById(id);
    }

    /**
     * 查询目标模板列表
     *
     * @param qiuGoalsModel 目标模板
     * @return 目标模板
     */
    @Override
    public List<QiuGoalsModel> selectQiuGoalsModelList(QiuGoalsModel qiuGoalsModel)
    {
        return qiuGoalsModelMapper.selectQiuGoalsModelList(qiuGoalsModel);
    }

    /**
     * 新增目标模板
     *
     * @param qiuGoalsModel 目标模板
     * @return 结果
     */
    @Override
    public int insertQiuGoalsModel(QiuGoalsModel qiuGoalsModel)
    {
        qiuGoalsModel.setCreateTime(DateUtils.getNowDate());
        return qiuGoalsModelMapper.insertQiuGoalsModel(qiuGoalsModel);
    }

    /**
     * 修改目标模板
     *
     * @param qiuGoalsModel 目标模板
     * @return 结果
     */
    @Override
    public int updateQiuGoalsModel(QiuGoalsModel qiuGoalsModel)
    {
        qiuGoalsModel.setUpdateTime(DateUtils.getNowDate());
        return qiuGoalsModelMapper.updateQiuGoalsModel(qiuGoalsModel);
    }

    /**
     * 批量删除目标模板
     *
     * @param ids 需要删除的目标模板主键
     * @return 结果
     */
    @Override
    public int deleteQiuGoalsModelByIds(Long[] ids)
    {
        return qiuGoalsModelMapper.deleteQiuGoalsModelByIds(ids);
    }

    /**
     * 删除目标模板信息
     *
     * @param id 目标模板主键
     * @return 结果
     */
    @Override
    public int deleteQiuGoalsModelById(Long id)
    {
        return qiuGoalsModelMapper.deleteQiuGoalsModelById(id);
    }
}
